Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Mesh Corners

Labels

ASCII
MeshCorners
Binary
crnr ( = 0x63726E72 )

Meshcorner Data Type

Uns32               vertexIndex
Uns32               nFaces
Uns32               faces[nFaces]
vertexIndex
The index of a vertex of the parent mesh.
nFaces
The number of faces of the parent mesh, sharing the vertex that is the value of the vertexIndex field, that are to be correlated with child objects of the mesh corners object. The value of this field must not exceed the number of faces of the parent mesh meeting at the vertex whose index is the value of the vertexIndex field.
faces[]
An array of face indices representing faces of the parent mesh. The vertex whose index is the value of the vertexIndex field must be among the vertices of each face of the parent mesh whose face index appears in this array. The number of fields of this array must equal the value of nFaces .

Data format

Uns32               nCorners
MeshCorner          corners[nCorners]
nCorners
The number of corners of the parent mesh treated by this mesh corners object.
corners[]
An array of mesh corners data types. The elements of this array are correlated with attribute sets which occur as child objects of the mesh corners object. The number of fields of this array must equal the value of nCorners .

Data Size

sizeof(MeshCorner) = 8 + nFaces * 4

sizeof(MeshCorners) = 4 + sizeof(corners[0...nCorners-1])

Description

The mesh corners object is used to attach more than one attribute set to a vertex of a mesh and to override other attributes inherited by a vertex or assigned to it elsewhere. You can use mesh corners in various ways: for example, to apply different normals and shadings in order to create the appearance of a sharp edge or peak. This object occurs only as a child object to a mesh and always has attribute sets as child objects of its own.

Parent Hierarchy

Data.

Parent Objects

Mesh (always).

Child Objects

Attribute sets (always). The number of child objects is equal to the value of the numCorners field. Child objects are correlated with elements of the array corners[] in the order of their occurrence in the specification of the mesh corners object and its child objects; that is, the i th child object is correlated with the i th element of the array corners[] .

Example

Container (
    Mesh (...)                      # parent mesh
    Container(
        MeshCorners (
            2                       # numCorners
            # Corner 0
            5 # vertexIndex
            2 # faces
            25 26 # face indices
            # Corner 1
            5 # vertexIndex
            2 # faces
            23 24 # face indices
        )
        Container (
            AttributeSet ( )
            Normal ( -0.2 0.8 0.3 )
        )
        Container (
            AttributeSet ( )
            Normal ( -0.7 -0.1 0.4 )
        )
    )
)

© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |